From: Georges Basile Stavracas Neto Date: Wed, 21 Oct 2020 18:40:20 +0000 (-0300) Subject: iconGrid: Allocate preferred sizes if bigger than child size X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~778 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4fcbf6c974f82541a756a769565dc9718be988af;p=gnome-shell.git iconGrid: Allocate preferred sizes if bigger than child size IconGridLayout uses the biggest minimum size to allocate its children. Next commit will make app icons with long names show not ellipsize on hover, and it is important that the icon itself is able to follow that. Use preferred size if it's bigger than the minimum size. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1477 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index d77898822..bc59b1bb0 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -765,7 +765,6 @@ var IconGridLayout = GObject.registerClass({ this._calculateSpacing(childSize); const childBox = new Clutter.ActorBox(); - childBox.set_size(childSize, childSize); let nChangedIcons = 0; @@ -802,6 +801,11 @@ var IconGridLayout = GObject.registerClass({ childBox.set_origin(x, y); + const [,, naturalWidth, naturalHeight] = item.get_preferred_size(); + childBox.set_size( + Math.max(childSize, naturalWidth), + Math.max(childSize, naturalHeight)); + // Only ease icons when the page size didn't change if (this._pageSizeChanged) item.allocate(childBox);